home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Interfaces / AIncludes / Connections.a < prev    next >
Encoding:
Text File  |  1996-01-24  |  12.8 KB  |  543 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Connections.a
  3. ;
  4. ;    Contains:    Communications Toolbox Connection Manager Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Package:    Universal Interfaces 2.2 in “MPW” on ETO #20
  8. ;
  9. ;    Copyright:    © 1984-1995 by Apple Computer, Inc.
  10. ;                All rights reserved.
  11. ;
  12. ;    Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13. ;                stack.  Include the file and version information (from above)
  14. ;                in the problem description and send to:
  15. ;                    Internet:    apple.bugs@applelink.apple.com
  16. ;                    AppleLink:    APPLE.BUGS
  17. ;
  18. ;
  19.  
  20.     IF &TYPE('__CONNECTIONS__') = 'UNDEFINED' THEN
  21. __CONNECTIONS__ SET 1
  22.  
  23.  
  24.     IF &TYPE('__WINDOWS__') = 'UNDEFINED' THEN
  25.     include 'Windows.a'
  26.     ENDIF
  27. ;        include 'Types.a'                                            ;
  28. ;            include 'ConditionalMacros.a'                            ;
  29. ;        include 'Memory.a'                                            ;
  30. ;            include 'MixedMode.a'                                    ;
  31. ;        include 'Quickdraw.a'                                        ;
  32. ;            include 'QuickdrawText.a'                                ;
  33. ;        include 'Events.a'                                            ;
  34. ;            include 'OSUtils.a'                                    ;
  35. ;        include 'Controls.a'                                        ;
  36. ;            include 'Menus.a'                                        ;
  37.  
  38.     IF &TYPE('__DIALOGS__') = 'UNDEFINED' THEN
  39.     include 'Dialogs.a'
  40.     ENDIF
  41. ;        include 'Errors.a'                                            ;
  42. ;        include 'TextEdit.a'                                        ;
  43.  
  44.     IF &TYPE('__CTBUTILITIES__') = 'UNDEFINED' THEN
  45.     include 'CTBUtilities.a'
  46.     ENDIF
  47. ;        include 'StandardFile.a'                                    ;
  48. ;            include 'Files.a'                                        ;
  49. ;                include 'Finder.a'                                    ;
  50. ;        include 'AppleTalk.a'                                        ;
  51.  
  52. ;    current Connection Manager version    
  53. curCMVersion                    EQU        2
  54. ;    current Connection Manager Environment Record version     
  55. curConnEnvRecVers                EQU        0
  56. ; CMErr 
  57. cmGenericError                    EQU        -1
  58. cmNoErr                            EQU        0
  59. cmRejected                        EQU        1
  60. cmFailed                        EQU        2
  61. cmTimeOut                        EQU        3
  62. cmNotOpen                        EQU        4
  63. cmNotClosed                        EQU        5
  64. cmNoRequestPending                EQU        6
  65. cmNotSupported                    EQU        7
  66. cmNoTools                        EQU        8
  67. cmUserCancel                    EQU        9
  68. cmUnknownError                    EQU        11
  69.  
  70. ; typedef OSErr             CMErr
  71.  
  72. cmData                            EQU        1 << 0
  73. cmCntl                            EQU        1 << 1
  74. cmAttn                            EQU        1 << 2
  75. cmDataNoTimeout                    EQU        1 << 4
  76. cmCntlNoTimeout                    EQU        1 << 5
  77. cmAttnNoTimeout                    EQU        1 << 6
  78. cmDataClean                        EQU        1 << 8
  79. cmCntlClean                        EQU        1 << 9
  80. cmAttnClean                        EQU        1 << 10
  81. ;        Only for CMRecFlags (not CMChannel) in the rest of this enum    
  82. cmNoMenus                        EQU        1 << 16
  83. cmQuiet                            EQU        1 << 17
  84. cmConfigChanged                    EQU        1 << 18
  85.  
  86. ; CMRecFlags and CMChannel        
  87. ;        Low word of CMRecFlags is same as CMChannel    
  88. ; typedef long                 CMRecFlags
  89. ; typedef short             CMChannel
  90.  
  91. cmStatusOpening                    EQU        1 << 0
  92. cmStatusOpen                    EQU        1 << 1
  93. cmStatusClosing                    EQU        1 << 2
  94. cmStatusDataAvail                EQU        1 << 3
  95. cmStatusCntlAvail                EQU        1 << 4
  96. cmStatusAttnAvail                EQU        1 << 5
  97. cmStatusDRPend                    EQU        1 << 6                ; data read pending    
  98. cmStatusDWPend                    EQU        1 << 7                ; data write pending    
  99. cmStatusCRPend                    EQU        1 << 8                ; cntl read pending    
  100. cmStatusCWPend                    EQU        1 << 9                ; cntl write pending    
  101. cmStatusARPend                    EQU        1 << 10                ; attn read pending    
  102. cmStatusAWPend                    EQU        1 << 11                ; attn write pending    
  103. cmStatusBreakPend                EQU        1 << 12
  104. cmStatusListenPend                EQU        1 << 13
  105. cmStatusIncomingCallPresent        EQU        1 << 14
  106. cmStatusReserved0                EQU        1 << 15
  107.  
  108. ; typedef unsigned long     CMStatFlags
  109.  
  110. cmDataIn                        EQU        0
  111. cmDataOut                        EQU        1
  112. cmCntlIn                        EQU        2
  113. cmCntlOut                        EQU        3
  114. cmAttnIn                        EQU        4
  115. cmAttnOut                        EQU        5
  116. cmRsrvIn                        EQU        6
  117. cmRsrvOut                        EQU        7
  118.  
  119. ; typedef unsigned short     CMBufFields
  120. ; typedef Ptr                 CMBuffers[8]
  121. ; typedef long                 CMBufferSizes[8]
  122.  
  123. cmSearchSevenBit                EQU        1 << 0
  124.  
  125. ; typedef unsigned short     CMSearchFlags
  126.  
  127. cmFlagsEOM                        EQU        1 << 0
  128.  
  129. ; typedef unsigned short     CMFlags
  130. ConnEnvironRec             RECORD    0
  131. version                     ds.w   1        ; offset: $0 (0)
  132. baudRate                 ds.l   1        ; offset: $2 (2)
  133. dataBits                 ds.w   1        ; offset: $6 (6)
  134. channels                 ds.w   1        ; offset: $8 (8)
  135. swFlowControl             ds.b   1        ; offset: $A (10)
  136. hwFlowControl             ds.b   1        ; offset: $B (11)
  137. flags                     ds.w   1        ; offset: $C (12)
  138. sizeof                     EQU *            ; size:   $E (14)
  139.                         ENDR
  140.  
  141. ; typedef struct ConnEnvironRec  ConnEnvironRec
  142. ; typedef ConnEnvironRec     *ConnEnvironRecPtr
  143. ; typedef struct ConnRecord  ConnRecord, *ConnPtr, **ConnHandle
  144. ConnRecord                 RECORD    0
  145. procID                     ds.w   1        ; offset: $0 (0)
  146. flags                     ds.l   1        ; offset: $2 (2)
  147. errCode                     ds.w   1        ; offset: $6 (6)
  148. refCon                     ds.l   1        ; offset: $8 (8)
  149. userData                 ds.l   1        ; offset: $C (12)
  150. defProc                     ds.l   1        ; offset: $10 (16)
  151. config                     ds.l   1        ; offset: $14 (20)
  152. oldConfig                 ds.l   1        ; offset: $18 (24)
  153. asyncEOM                 ds.l   1        ; offset: $1C (28)
  154. reserved1                 ds.l   1        ; offset: $20 (32)
  155. reserved2                 ds.l   1        ; offset: $24 (36)
  156. cmPrivate                 ds.l   1        ; offset: $28 (40)
  157. bufferArray                 ds.l   8        ; offset: $2C (44)
  158. bufSizes                 ds.l   8        ; offset: $4C (76)
  159. mluField                 ds.l   1        ; offset: $6C (108)
  160. asyncCount                 ds.l   8        ; offset: $70 (112)
  161. sizeof                     EQU *            ; size:   $90 (144)
  162.                         ENDR
  163.  
  164.  
  165. ; CMIOPB constants and structure 
  166. cmIOPBQType                        EQU        10
  167. cmIOPBversion                    EQU        0
  168.  
  169. CMIOPB                     RECORD    0
  170. qLink                     ds.l   1        ; offset: $0 (0)
  171. qType                     ds.w   1        ; offset: $4 (4)        ; cmIOPBQType 
  172. hConn                     ds.l   1        ; offset: $6 (6)
  173. theBuffer                 ds.l   1        ; offset: $A (10)
  174. count                     ds.l   1        ; offset: $E (14)
  175. flags                     ds.w   1        ; offset: $12 (18)
  176. userCompletion             ds.l   1        ; offset: $14 (20)
  177. timeout                     ds.l   1        ; offset: $18 (24)
  178. errCode                     ds.w   1        ; offset: $1C (28)
  179. channel                     ds.w   1        ; offset: $1E (30)
  180. asyncEOM                 ds.l   1        ; offset: $20 (32)
  181. reserved1                 ds.l   1        ; offset: $24 (36)
  182. reserved2                 ds.w   1        ; offset: $28 (40)
  183. version                     ds.w   1        ; offset: $2A (42)        ; cmIOPBversion 
  184. refCon                     ds.l   1        ; offset: $2C (44)        ; for application 
  185. toolData1                 ds.l   1        ; offset: $30 (48)        ; for tool 
  186. toolData2                 ds.l   1        ; offset: $34 (52)        ; for tool 
  187. sizeof                     EQU *            ; size:   $38 (56)
  188.                         ENDR
  189.  
  190. ; typedef struct CMIOPB     CMIOPB
  191. ; typedef CMIOPB             *CMIOPBPtr
  192. ;
  193. ; pascal CMErr InitCM(void)
  194. ;
  195.     IF GENERATINGCFM THEN
  196.         IMPORT_CFM_FUNCTION    InitCM
  197.     ENDIF
  198.  
  199. ;
  200. ; pascal Handle CMGetVersion(ConnHandle hConn)
  201. ;
  202.     IF GENERATINGCFM THEN
  203.         IMPORT_CFM_FUNCTION    CMGetVersion
  204.     ENDIF
  205.  
  206. ;
  207. ; pascal short CMGetCMVersion(void)
  208. ;
  209.     IF GENERATINGCFM THEN
  210.         IMPORT_CFM_FUNCTION    CMGetCMVersion
  211.     ENDIF
  212.  
  213. ;
  214. ; pascal ConnHandle CMNew(short procID, CMRecFlags flags, CMBufferSizes desiredSizes, long refCon, long userData)
  215. ;
  216.     IF GENERATINGCFM THEN
  217.         IMPORT_CFM_FUNCTION    CMNew
  218.     ENDIF
  219.  
  220. ;
  221. ; pascal void CMDispose(ConnHandle hConn)
  222. ;
  223.     IF GENERATINGCFM THEN
  224.         IMPORT_CFM_FUNCTION    CMDispose
  225.     ENDIF
  226.  
  227. ;
  228. ; pascal CMErr CMListen(ConnHandle hConn, Boolean async, ConnectionCompletionUPP completor, long timeout)
  229. ;
  230.     IF GENERATINGCFM THEN
  231.         IMPORT_CFM_FUNCTION    CMListen
  232.     ENDIF
  233.  
  234. ;
  235. ; pascal CMErr CMAccept(ConnHandle hConn, Boolean accept)
  236. ;
  237.     IF GENERATINGCFM THEN
  238.         IMPORT_CFM_FUNCTION    CMAccept
  239.     ENDIF
  240.  
  241. ;
  242. ; pascal CMErr CMOpen(ConnHandle hConn, Boolean async, ConnectionCompletionUPP completor, long timeout)
  243. ;
  244.     IF GENERATINGCFM THEN
  245.         IMPORT_CFM_FUNCTION    CMOpen
  246.     ENDIF
  247.  
  248. ;
  249. ; pascal CMErr CMClose(ConnHandle hConn, Boolean async, ConnectionCompletionUPP completor, long timeout, Boolean now)
  250. ;
  251.     IF GENERATINGCFM THEN
  252.         IMPORT_CFM_FUNCTION    CMClose
  253.     ENDIF
  254.  
  255. ;
  256. ; pascal CMErr CMAbort(ConnHandle hConn)
  257. ;
  258.     IF GENERATINGCFM THEN
  259.         IMPORT_CFM_FUNCTION    CMAbort
  260.     ENDIF
  261.  
  262. ;
  263. ; pascal CMErr CMStatus(ConnHandle hConn, CMBufferSizes sizes, CMStatFlags *flags)
  264. ;
  265.     IF GENERATINGCFM THEN
  266.         IMPORT_CFM_FUNCTION    CMStatus
  267.     ENDIF
  268.  
  269. ;
  270. ; pascal void CMIdle(ConnHandle hConn)
  271. ;
  272.     IF GENERATINGCFM THEN
  273.         IMPORT_CFM_FUNCTION    CMIdle
  274.     ENDIF
  275.  
  276. ;
  277. ; pascal void CMReset(ConnHandle hConn)
  278. ;
  279.     IF GENERATINGCFM THEN
  280.         IMPORT_CFM_FUNCTION    CMReset
  281.     ENDIF
  282.  
  283. ;
  284. ; pascal void CMBreak(ConnHandle hConn, long duration, Boolean async, ConnectionCompletionUPP completor)
  285. ;
  286.     IF GENERATINGCFM THEN
  287.         IMPORT_CFM_FUNCTION    CMBreak
  288.     ENDIF
  289.  
  290. ;
  291. ; pascal CMErr CMRead(ConnHandle hConn, void *theBuffer, long *toRead, CMChannel theChannel, Boolean async, ConnectionCompletionUPP completor, long timeout, CMFlags *flags)
  292. ;
  293.     IF GENERATINGCFM THEN
  294.         IMPORT_CFM_FUNCTION    CMRead
  295.     ENDIF
  296.  
  297. ;
  298. ; pascal CMErr CMWrite(ConnHandle hConn, const void *theBuffer, long *toWrite, CMChannel theChannel, Boolean async, ConnectionCompletionUPP completor, long timeout, CMFlags flags)
  299. ;
  300.     IF GENERATINGCFM THEN
  301.         IMPORT_CFM_FUNCTION    CMWrite
  302.     ENDIF
  303.  
  304. ;
  305. ; pascal CMErr CMIOKill(ConnHandle hConn, short which)
  306. ;
  307.     IF GENERATINGCFM THEN
  308.         IMPORT_CFM_FUNCTION    CMIOKill
  309.     ENDIF
  310.  
  311. ;
  312. ; pascal void CMActivate(ConnHandle hConn, Boolean activate)
  313. ;
  314.     IF GENERATINGCFM THEN
  315.         IMPORT_CFM_FUNCTION    CMActivate
  316.     ENDIF
  317.  
  318. ;
  319. ; pascal void CMResume(ConnHandle hConn, Boolean resume)
  320. ;
  321.     IF GENERATINGCFM THEN
  322.         IMPORT_CFM_FUNCTION    CMResume
  323.     ENDIF
  324.  
  325. ;
  326. ; pascal Boolean CMMenu(ConnHandle hConn, short menuID, short item)
  327. ;
  328.     IF GENERATINGCFM THEN
  329.         IMPORT_CFM_FUNCTION    CMMenu
  330.     ENDIF
  331.  
  332. ;
  333. ; pascal Boolean CMValidate(ConnHandle hConn)
  334. ;
  335.     IF GENERATINGCFM THEN
  336.         IMPORT_CFM_FUNCTION    CMValidate
  337.     ENDIF
  338.  
  339. ;
  340. ; pascal void CMDefault(Ptr *theConfig, short procID, Boolean allocate)
  341. ;
  342.     IF GENERATINGCFM THEN
  343.         IMPORT_CFM_FUNCTION    CMDefault
  344.     ENDIF
  345.  
  346. ;
  347. ; pascal Handle CMSetupPreflight(short procID, long *magicCookie)
  348. ;
  349.     IF GENERATINGCFM THEN
  350.         IMPORT_CFM_FUNCTION    CMSetupPreflight
  351.     ENDIF
  352.  
  353. ;
  354. ; pascal Boolean CMSetupFilter(short procID, const void *theConfig, short count, DialogPtr theDialog, EventRecord *theEvent, short *theItem, long *magicCookie)
  355. ;
  356.     IF GENERATINGCFM THEN
  357.         IMPORT_CFM_FUNCTION    CMSetupFilter
  358.     ENDIF
  359.  
  360. ;
  361. ; pascal void CMSetupSetup(short procID, const void *theConfig, short count, DialogPtr theDialog, long *magicCookie)
  362. ;
  363.     IF GENERATINGCFM THEN
  364.         IMPORT_CFM_FUNCTION    CMSetupSetup
  365.     ENDIF
  366.  
  367. ;
  368. ; pascal void CMSetupItem(short procID, const void *theConfig, short count, DialogPtr theDialog, short *theItem, long *magicCookie)
  369. ;
  370.     IF GENERATINGCFM THEN
  371.         IMPORT_CFM_FUNCTION    CMSetupItem
  372.     ENDIF
  373.  
  374. ;
  375. ; pascal void CMSetupXCleanup(short procID, const void *theConfig, short count, DialogPtr theDialog, Boolean OKed, long *magicCookie)
  376. ;
  377.     IF GENERATINGCFM THEN
  378.         IMPORT_CFM_FUNCTION    CMSetupXCleanup
  379.     ENDIF
  380.  
  381. ;
  382. ; pascal void CMSetupPostflight(short procID)
  383. ;
  384.     IF GENERATINGCFM THEN
  385.         IMPORT_CFM_FUNCTION    CMSetupPostflight
  386.     ENDIF
  387.  
  388. ;
  389. ; pascal Ptr CMGetConfig(ConnHandle hConn)
  390. ;
  391.     IF GENERATINGCFM THEN
  392.         IMPORT_CFM_FUNCTION    CMGetConfig
  393.     ENDIF
  394.  
  395. ;
  396. ; pascal short CMSetConfig(ConnHandle hConn, const void *thePtr)
  397. ;
  398.     IF GENERATINGCFM THEN
  399.         IMPORT_CFM_FUNCTION    CMSetConfig
  400.     ENDIF
  401.  
  402. ;
  403. ; pascal OSErr CMIntlToEnglish(ConnHandle hConn, const void *inputPtr, Ptr *outputPtr, short language)
  404. ;
  405.     IF GENERATINGCFM THEN
  406.         IMPORT_CFM_FUNCTION    CMIntlToEnglish
  407.     ENDIF
  408.  
  409. ;
  410. ; pascal OSErr CMEnglishToIntl(ConnHandle hConn, const void *inputPtr, Ptr *outputPtr, short language)
  411. ;
  412.     IF GENERATINGCFM THEN
  413.         IMPORT_CFM_FUNCTION    CMEnglishToIntl
  414.     ENDIF
  415.  
  416. ;
  417. ; pascal long CMAddSearch(ConnHandle hConn, ConstStr255Param theString, CMSearchFlags flags, ConnectionSearchCallBackUPP callBack)
  418. ;
  419.     IF GENERATINGCFM THEN
  420.         IMPORT_CFM_FUNCTION    CMAddSearch
  421.     ENDIF
  422.  
  423. ;
  424. ; pascal void CMRemoveSearch(ConnHandle hConn, long refnum)
  425. ;
  426.     IF GENERATINGCFM THEN
  427.         IMPORT_CFM_FUNCTION    CMRemoveSearch
  428.     ENDIF
  429.  
  430. ;
  431. ; pascal void CMClearSearch(ConnHandle hConn)
  432. ;
  433.     IF GENERATINGCFM THEN
  434.         IMPORT_CFM_FUNCTION    CMClearSearch
  435.     ENDIF
  436.  
  437. ;
  438. ; pascal CMErr CMGetConnEnvirons(ConnHandle hConn, ConnEnvironRec *theEnvirons)
  439. ;
  440.     IF GENERATINGCFM THEN
  441.         IMPORT_CFM_FUNCTION    CMGetConnEnvirons
  442.     ENDIF
  443.  
  444. ;
  445. ; pascal short CMChoose(ConnHandle *hConn, Point where, ConnectionChooseIdleUPP idle)
  446. ;
  447.     IF GENERATINGCFM THEN
  448.         IMPORT_CFM_FUNCTION    CMChoose
  449.     ENDIF
  450.  
  451. ;
  452. ; pascal void CMEvent(ConnHandle hConn, const EventRecord *theEvent)
  453. ;
  454.     IF GENERATINGCFM THEN
  455.         IMPORT_CFM_FUNCTION    CMEvent
  456.     ENDIF
  457.  
  458. ;
  459. ; pascal void CMGetToolName(short procID, Str255 name)
  460. ;
  461.     IF GENERATINGCFM THEN
  462.         IMPORT_CFM_FUNCTION    CMGetToolName
  463.     ENDIF
  464.  
  465. ;
  466. ; pascal short CMGetProcID(ConstStr255Param name)
  467. ;
  468.     IF GENERATINGCFM THEN
  469.         IMPORT_CFM_FUNCTION    CMGetProcID
  470.     ENDIF
  471.  
  472. ;
  473. ; pascal void CMSetRefCon(ConnHandle hConn, long refCon)
  474. ;
  475.     IF GENERATINGCFM THEN
  476.         IMPORT_CFM_FUNCTION    CMSetRefCon
  477.     ENDIF
  478.  
  479. ;
  480. ; pascal long CMGetRefCon(ConnHandle hConn)
  481. ;
  482.     IF GENERATINGCFM THEN
  483.         IMPORT_CFM_FUNCTION    CMGetRefCon
  484.     ENDIF
  485.  
  486. ;
  487. ; pascal long CMGetUserData(ConnHandle hConn)
  488. ;
  489.     IF GENERATINGCFM THEN
  490.         IMPORT_CFM_FUNCTION    CMGetUserData
  491.     ENDIF
  492.  
  493. ;
  494. ; pascal void CMSetUserData(ConnHandle hConn, long userData)
  495. ;
  496.     IF GENERATINGCFM THEN
  497.         IMPORT_CFM_FUNCTION    CMSetUserData
  498.     ENDIF
  499.  
  500. ;
  501. ; pascal void CMGetErrorString(ConnHandle hConn, short id, Str255 errMsg)
  502. ;
  503.     IF GENERATINGCFM THEN
  504.         IMPORT_CFM_FUNCTION    CMGetErrorString
  505.     ENDIF
  506.  
  507. ;
  508. ; pascal CMErr CMNewIOPB(ConnHandle hConn, CMIOPBPtr *theIOPB)
  509. ;
  510.     IF GENERATINGCFM THEN
  511.         IMPORT_CFM_FUNCTION    CMNewIOPB
  512.     ENDIF
  513.  
  514. ;
  515. ; pascal CMErr CMDisposeIOPB(ConnHandle hConn, CMIOPBPtr theIOPB)
  516. ;
  517.     IF GENERATINGCFM THEN
  518.         IMPORT_CFM_FUNCTION    CMDisposeIOPB
  519.     ENDIF
  520.  
  521. ;
  522. ; pascal CMErr CMPBRead(ConnHandle hConn, CMIOPBPtr theIOPB, Boolean async)
  523. ;
  524.     IF GENERATINGCFM THEN
  525.         IMPORT_CFM_FUNCTION    CMPBRead
  526.     ENDIF
  527.  
  528. ;
  529. ; pascal CMErr CMPBWrite(ConnHandle hConn, CMIOPBPtr theIOPB, Boolean async)
  530. ;
  531.     IF GENERATINGCFM THEN
  532.         IMPORT_CFM_FUNCTION    CMPBWrite
  533.     ENDIF
  534.  
  535. ;
  536. ; pascal CMErr CMPBIOKill(ConnHandle hConn, CMIOPBPtr theIOPB)
  537. ;
  538.     IF GENERATINGCFM THEN
  539.         IMPORT_CFM_FUNCTION    CMPBIOKill
  540.     ENDIF
  541.  
  542.     ENDIF ; __CONNECTIONS__
  543.